<?php

/**
 * @author trongkhoi
 */
class PartnerController extends CrudController
{
    public $modelName = 'Partners';
    public $title = 'Partner';

    public function init()
    {
        parent::init();
        $this->indexColumns = array(
//            array(
//                'class' => 'CCheckBoxColumn',
//                'id' => 'ids',
//                'selectableRows' => 2,
//            ),
            array(
                'header' => Yii::t('user', 'Name'),
                'name' => 'name',
                'type' => 'raw',
                'value' => 'CHtml::link($data->name,$data->editUrl,array("target"=>"blank"))',
                'filter' => CHtml::textField('name', getQuery('name', ''), array('placeHolder' => Yii::t('user', 'Search'))),
            ),
            array(
                'header' => Yii::t('user', 'Picture'),
                'name' => 'picture',
                'type' => 'raw',
                'value' => 'CHtml::image($data->getPublicImg(),"",array("width"=>80,"height"=>80))',
                'filter' => false,
            ),
            array('class' => 'application.widgets.MyButtonColumn',
                'editUrl' => '$data->editUrl',
                'deleteUrl' => '#',
            ),
        );

        $this->formColumns = array(
            'name',
//            'category' => array(
//                'type' => 'dropDownList',
//                'data' => Category::getPublicArray(),
//            ),
//            'status' => array(
//                'type' => 'radioButtonList',
//                'data' => MyActiveRecord::getArrayStatus(),
//            ),
            'picture' => array(
                'type' => 'ckfinder',
                'alt' => 'ckfinder',
                'data' => $this->model->getPublicImg()
            )
        );
    }

}

/** 
* End file ProfileController
*/
